home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / dflat8.zip / RECT.H < prev    next >
Text File  |  1991-07-18  |  880b  |  25 lines

  1. /* ----------- rect.h ------------ */
  2. #ifndef RECT_H
  3. #define RECT_H
  4.  
  5. typedef struct    {
  6.     int lf,tp,rt,bt;
  7. } RECT;
  8. #define within(p,v1,v2)   ((p)>=(v1)&&(p)<=(v2))
  9. #define RectTop(r)        (r.tp)
  10. #define RectBottom(r)     (r.bt)
  11. #define RectLeft(r)       (r.lf)
  12. #define RectRight(r)      (r.rt)
  13. #define InsideRect(x,y,r) (within((x),RectLeft(r),RectRight(r))\
  14.                                &&                              \
  15.                           within((y),RectTop(r),RectBottom(r)))
  16. #define ValidRect(r)      (RectRight(r) || RectLeft(r) || \
  17.                            RectTop(r) || RectBottom(r))
  18. #define RectWidth(r)      (RectRight(r)-RectLeft(r)+1)
  19. #define RectHeight(r)     (RectBottom(r)-RectTop(r)+1)
  20. RECT subRectangle(RECT, RECT);
  21. RECT ClientRect(void *);
  22. RECT RelativeWindowRect(void *, RECT);
  23. RECT ClipRectangle(void *, RECT);
  24. #endif
  25.